//
//  LHQDestinationBeautytripDetailTableViewCell.m
//  God_is_a_Girl
//
//  Created by dllo on 15/9/28.
//  Copyright (c) 2015年 呸. All rights reserved.
//

#import "LHQDestinationBeautytripDetailTableViewCell.h"
#import <UIImageView+WebCache.h>
@implementation LHQDestinationBeautytripDetailTableViewCell

-(instancetype)initWithStyle:(UITableViewCellStyle)style reuseIdentifier:(NSString *)reuseIdentifier
{
    self = [super  initWithStyle:style reuseIdentifier:reuseIdentifier];
    if (self) {
        self.cover_image_default = [[UIImageView  alloc]init];
        [self.contentView addSubview:self.cover_image_default];
       
        self.day_count = [[UILabel alloc] init];
        [self.contentView  addSubview:self.day_count];
        
        self.name = [[UILabel  alloc] init];
        [self.name setFont:[UIFont fontWithName:@"Helvetica-Bold" size:17]];
        
        [self.contentView  addSubview:self.name];
        
        self.waypoints = [[UILabel  alloc] init];
        self.waypoints.backgroundColor = [UIColor  lightGrayColor];
        [self.contentView  addSubview:self.waypoints];
        
        self.recommendations = [[UILabel alloc] init];
        self.recommendations.backgroundColor = [UIColor  lightGrayColor];
        [self.contentView  addSubview:self.recommendations];
        
        
    }
    return self;
}

-(void)layoutSubviews
{
    
    [super  layoutSubviews];
    
    self.cover_image_default.frame = CGRectMake(10, 0, self.frame.size.width-20, 190);
    self.cover_image_default.layer.cornerRadius = 10;
    self.cover_image_default.layer.masksToBounds = YES;
    
    
    self.name.frame = CGRectMake(15, 0, self.frame.size.width, 50);
    [self.name setTextColor:[UIColor whiteColor]];
    self.name.numberOfLines = 0;
    
    
    self.day_count.frame = CGRectMake(15, 30, 80, 50);
    [self.day_count setTextColor:[UIColor whiteColor]];
    self.day_count.font = [UIFont systemFontOfSize:13];
    
    
    
    self.waypoints.frame = CGRectMake(10, 140, 120, 20);
    
    [self.waypoints setTextColor:[UIColor whiteColor]];
    self.waypoints.backgroundColor = [UIColor  colorWithRed:0 green:0 blue:0 alpha:0.7];
    self.waypoints.font = [UIFont systemFontOfSize:13];
    
    self.recommendations.frame = CGRectMake(130, 140, self.frame.size.width-140, 20);
    [self.recommendations setTextColor:[UIColor  whiteColor]];
    
    self.recommendations.backgroundColor = [UIColor  colorWithRed:0 green:0 blue:0 alpha:0.7];
    
    self.recommendations.font = [UIFont systemFontOfSize:13];
    
    
}

-(void)setModel:(LHQDestinationBeautyTripDetailModel *)model
{
    
   [self.cover_image_default sd_setImageWithURL:[NSURL URLWithString:model.cover_image_default] placeholderImage:[UIImage  imageNamed:@"1436964361872.jpg"]];
    
    self.name.text = model.name;
    
    self.day_count.text = [NSString  stringWithFormat:@"历经%@天",model.day_count];
    
    self.waypoints.text = [NSString  stringWithFormat:@"  %@足迹",model.waypoints];
    
    self.recommendations.text = [NSString stringWithFormat:@"%@喜欢",model.recommendations];
    
}























- (void)awakeFromNib {
    // Initialization code
}

- (void)setSelected:(BOOL)selected animated:(BOOL)animated {
    [super setSelected:selected animated:animated];

    // Configure the view for the selected state
}

@end
